<!--这里是用户管理<br/>-->

<section class="listSection">
  <div class="listNav">
    环境服务机构管理 > 环境服务机构企业基本信息管理
  </div>
  <section class="content selectContent first-content">
    <div class="row">
      <div class="listBackgroungSelect text-center">
        <span>信息查询</span>
      </div>
      <div class="col-md-12 col-sm-12 col-xs-12 listSectionSelect" >
        <form class="form-inline" #companyForm="ngForm" (ngSubmit)="doSearch(companyForm.value, 'submit')">
          <div class="row">
            <div class="form-group search-list">
              <label>设备制造企业：</label>
              <input type="text" class="form-control" name="manufacturingName" mdInput [(ngModel)]="manufacturingName" placeholder="请输入名称">
            </div>
            <div class="form-group search-list">
              <label>组织机构代码：</label>
              <input type="text" class="form-control" name="orgCode" mdInput [(ngModel)]="orgCode" placeholder="请输入代码"  >
            </div>
            <div class="form-group search-list">
              <label>仪器厂商类型：</label>
              <select class="form-control selectStyle " name="instrumentType" [(ngModel)]="instrumentType">
                <option [value]="0">检测仪</option>
                <option [value]="1">数采仪</option>
                <option [value]="2">两者都是</option>
              </select>
            </div>
            <div class="form-group search-list-btn">
              <button class="btn selectButtonOfA search-btn"  type="submit">查询</button>

            </div>
          </div>
          <div class="row">
            <div class="form-group search-list">
              <label>统一社会信用码：</label>
              <input type="text" class="form-control" name="userCode" mdInput [(ngModel)]="userCode" placeholder="请输入信用码"  >
            </div>
            <div class="form-group search-list">
            </div>
            <div class="form-group search-list">
            </div>
            <div class="form-group search-list-btn">
              <button class="btn selectButtonOfA reset-btn" md-raised-button type="button" (click)="companyForm.resetForm({})">清除</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </section>


  <section class="content">
    <div class="row">
      <div class="listBackgroungSelect text-center">
        <span>基本信息</span>
      </div>
      <div class="col-md-12 col-sm-12 col-xs-12">
        <form action="" >
          <div class="box-body">
            <div class="add-box clearfix">
              <button  class="btn add-tit" data-toggle="modal" data-target="#addModal">新增</button>
            </div>
            <table border="1" cellspacing="0"  class="table text-center listTable">
              <tr class="header-tab">
                <th>设备制造企业</th>
                <th>组织机构代码</th>
                <th>统一社会信用码</th>
                <th>负责人</th>
                <th>仪器厂商</th>
                <th>制造商</th>
                <th>操作</th>
              </tr>
              <tr *ngFor="let list of dataList">
                <td>{{list.manufacturingName}}</td>
                <td>{{list.orgCode}}</td>
                <td>{{list.userCode}}</td>
                <td>{{list.chargePerson}}</td>
                <td>{{list.instrumentType | companyPipe}}</td>
                <td>{{list.manufacturerType | manufacturerTypePipe}}</td>
                <td>
                <span>
                   <img src="assets/icon/see.png" class="list-icon">
                      <a href="#" data-toggle="modal" data-target="#myModal" (click)="userMessage(list)">查看</a>

                  </span>
                  <span>
                    <img src="assets/icon/edit.png" class="list-icon">
                      <a href="#" data-toggle="modal" data-target="#updateModal" (click)="userMessage(list)">编辑</a>
                  </span>
                  <span>
                    <img src="assets/icon/delete.png" class="list-icon">
                      <a href="#" data-toggle="modal" data-target="#deleteModal" (click)="delete(list.id)">删除</a>
                  </span>
                </td>
              </tr>
            </table>
          </div>
          <app-pagination
            [totalItems]="pageInfo.totalItems"
            [currentPage]="pageInfo.currentPage"
            [pageSize]="pageInfo.pageSize"
            (onReGetPage)="setPage($event)">
          </app-pagination>

        </form>
      </div>
    </div>
  </section>

  <!-- 详情 -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header text-center" >
          <div class="col-md-10 col-md-offset-1" style="margin-top: 20px;">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">查看详情</h4>
          </div>
        </div>
        <div class="modal-body">

          <div class="row">
            <div class="col-md-10 col-md-offset-1">
              <table class="table detailsTable">
                <tr>
                  <td>设备制造企业：</td>
                  <td>{{lookInfo.manufacturingName}}</td>
                </tr>
                <tr>
                  <td>组织机构代码：</td>
                  <td>{{lookInfo.orgCode }}</td>
                </tr>
                <tr>
                  <td>统一社会信用码：</td>
                  <td>{{lookInfo.userCode  }}</td>
                </tr>
                <tr>
                  <td>仪器厂商类型：</td>
                  <td>{{lookInfo.instrumentType | companyPipe}}</td>
                </tr>
                <tr>
                  <td>制造商类型：</td>
                  <td>{{lookInfo.manufacturerType | manufacturerTypePipe }}</td>
                </tr>
                <tr>
                  <td>负责人：</td>
                  <td>{{lookInfo.chargePerson  }}</td>
                </tr>
                <tr>
                  <td>联系方式：</td>
                  <td>{{lookInfo.contactNumber}}</td>
                </tr>
                <tr>
                  <td>邮箱：</td>
                  <td>{{lookInfo.email }}</td>
                </tr>
                <tr>
                  <td>地址：</td>
                  <td>{{lookInfo.address  }}</td>
                </tr>
              </table>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button class="btn selectButtonOfA close-btn" role="button" data-dismiss="modal">返回</button>
        </div>
      </div>
    </div>
  </div>

  <!--添加-->
  <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" data-target=".bs-example-modal-lg">
    <div class="modal-dialog" role="document">
      <form #addFrom="ngForm" (ngSubmit)="doAdd(addFrom.value,addFrom.valid)" novalidate>
        <div class="modal-content">
          <div class="modal-header text-center" >
            <div class="col-md-10 col-md-offset-1" style="margin-top: 20px;">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="addModalLabel">新增</h4>
            </div>
          </div>
          <div class="modal-body">
            <div class="row">
              <div class="col-md-10 col-md-offset-1">

                <table class="table detailsTable">
                  <tr>
                    <td><span class="red">*</span>设备制造企业：</td>
                    <td><input type="text" class="form-control"  placeholder="请输入" name="manufacturingName" [(ngModel)]="addmanufacturingName" required ></td>
                    <td class="prompt-box"><div [hidden]="!addFrom.form.hasError('required','manufacturingName')" class="prompt"></div></td>
                  </tr>
                  <tr>
                    <td><span class="red">*</span>组织机构代码：</td>
                    <td><input type="text" class="form-control clear-input"  placeholder="请输入" name="orgCode" ngModel></td>
                    <td class="prompt-box"><div [hidden]="!addFrom.form.hasError('required','orgCode')" class="prompt"></div></td>
                  </tr>
                  <tr>
                    <td><span class="red">*</span>统一社会信用码：</td>
                    <td><input type="text" class="form-control"  placeholder="请输入" name="userCode" [(ngModel)]="adduserCode" required ></td>
                    <td class="prompt-box"><div [hidden]="!addFrom.form.hasError('required','userCode')" class="prompt"></div></td>
                  </tr>
                  <tr>
                    <td><span class="red">*</span>仪器厂商类型：</td>
                    <td><select class="form-control selectStyle " name="instrumentType" [(ngModel)]="addinstrumentType"   required >
                      <option [value]="0">检测仪</option>
                      <option [value]="1">数采仪</option>
                      <option [value]="2">两者都是</option>
                    </select></td>
                    <td class="prompt-box"><div [hidden]="!addFrom.form.hasError('required','instrumentType')" class="prompt"></div></td>
                  </tr>
                  <tr>
                    <td><span class="red">*</span>制造商类型：</td>
                    <td><select class="form-control selectStyle " name="manufacturerType" [(ngModel)]="addmanufacturerType"   required >
                      <option [value]="0">生产设施制造单位</option>
                      <option [value]="1">生产设施集成单位</option>
                      <option [value]="2">生产设施运维单位</option>
                      <option [value]="3">污染治理设施制造单位</option>
                      <option [value]="4">污染治理工程集成单位</option>
                      <option [value]="5">污染治理设施运维单位</option>
                      <option [value]="6">环境自动检测设施制造单位</option>
                      <option [value]="7">环境自动检测设施建设安装单位</option>
                      <option [value]="8">环境自动检测设施运维单位</option>
                      <option [value]="9">环境检测服务单位</option>
                      <option [value]="10">环境信息系统集成单位</option>

                    </select></td>
                    <td class="prompt-box"><div [hidden]="!addFrom.form.hasError('required','manufacturerType')" class="prompt"></div></td>
                  </tr>
                  <tr>
                    <td>负责人：</td>
                    <td><input type="text" class="form-control clear-input"  placeholder="请输入" name="chargePerson" ngModel></td>
                  </tr>
                  <tr>
                    <td>联系方式：</td>
                    <td><input type="text" class="form-control clear-input"  placeholder="请输入" name="contactNumber" ngModel></td>
                  </tr>
                  <tr>
                    <td>邮箱：</td>
                    <td><input type="text" class="form-control clear-input"  placeholder="请输入" name="email"  ngModel ></td>
                  </tr>
                  <tr>
                    <td>地址：</td>
                    <td><textarea class="form-control clear-input" rows="3" name="address" ngModel></textarea></td>
                  </tr>
                </table>
              </div>
            </div>
          </div>
          <div class="modal-footer text-center">
            <button class="btn selectButtonOfA sumbit-btn"  type="submit" [disabled]="!addFrom.form.valid">提交</button>
            <button class="btn selectButtonOfA close-btn" role="button" data-dismiss="modal">返回</button>

          </div>
        </div>
      </form>
    </div>
  </div>

  <!--编辑-->
  <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
    <div class="modal-dialog" role="document">
      <form #editFrom="ngForm" (ngSubmit)="doEdit(editFrom.value,editFrom.valid)" novalidate>
      <div class="modal-content">
        <div class="modal-header text-center" >
          <div class="col-md-10 col-md-offset-1" style="margin-top: 20px;">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="updateModalLabel">编辑</h4>
          </div>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-md-10 col-md-offset-1">
              <table class="table detailsTable">
                <tr>
                  <td><span class="red">*</span>设备制造企业：</td>
                  <td><input type="text" class="form-control" name="manufacturingName" [(ngModel)]="lookInfo.manufacturingName" required>
                    <input type="hidden" class="form-control" name="id" [(ngModel)]="lookInfo.id"></td>
                  <td class="prompt-box"><div [hidden]="!editFrom.form.hasError('required','manufacturingName')" class="prompt"></div></td>
                </tr>
                <tr>
                  <td><span class="red">*</span>组织机构代码：</td>
                  <td><input type="text" class="form-control"  placeholder="请输入" name="orgCode" [(ngModel)]="lookInfo.orgCode" ></td>
                  <td class="prompt-box"><div [hidden]="!editFrom.form.hasError('required','orgCode')" class="prompt"></div></td>
                </tr>
                <tr>
                  <td><span class="red">*</span>统一社会信用码：</td>
                  <td><input type="text" class="form-control"  placeholder="请输入" name="userCode" [(ngModel)]="lookInfo.userCode" ></td>
                </tr>
                <tr>
                  <td><span class="red">*</span>仪器厂商类型：</td>
                  <td><select class="form-control selectStyle " name="instrumentType" [(ngModel)]="lookInfo.instrumentType" required >
                    <option [value]="0">检测仪</option>
                    <option [value]="1">数采仪</option>
                    <option [value]="2">两者都是</option>
                  </select></td>
                  <td class="prompt-box"><div [hidden]="!editFrom.form.hasError('required','instrumentType')" class="prompt"></div></td>
                </tr>
                <tr>
                  <td><span class="red">*</span>制造商类型：</td>
                  <td><select class="form-control selectStyle " name="manufacturerType" [(ngModel)]="lookInfo.manufacturerType" required >
                    <option [value]="0">生产设施制造单位</option>
                    <option [value]="1">生产设施集成单位</option>
                    <option [value]="2">生产设施运维单位</option>
                    <option [value]="3">污染治理设施制造单位</option>
                    <option [value]="4">污染治理工程集成单位</option>
                    <option [value]="5">污染治理设施运维单位</option>
                    <option [value]="6">环境自动检测设施制造单位</option>
                    <option [value]="7">环境自动检测设施建设安装单位</option>
                    <option [value]="8">环境自动检测设施运维单位</option>
                    <option [value]="9">环境检测服务单位</option>
                    <option [value]="10">环境信息系统集成单位</option>
                  </select></td>
                  <td class="prompt-box"><div [hidden]="!editFrom.form.hasError('required','manufacturerType')" class="prompt"></div></td>
                </tr>
                <tr>
                  <td>负责人：</td>
                  <td><input type="text" class="form-control"  placeholder="请输入" name="chargePerson" [(ngModel)]="lookInfo.chargePerson" ></td>
                </tr>
                <tr>
                  <td>联系方式：</td>
                  <td><input type="text" class="form-control"  placeholder="请输入" name="contactNumber" [(ngModel)]="lookInfo.contactNumber"></td>
                </tr>
                <tr>
                  <td>邮箱：</td>
                  <td><input type="text" class="form-control"  placeholder="请输入" name="email" [(ngModel)]="lookInfo.email" ></td>
                </tr>
                <tr>
                  <td>地址：</td>
                  <td><textarea class="form-control" rows="3" name="address" [(ngModel)]="lookInfo.address"></textarea></td>
                </tr>
              </table>
            </div>
          </div>
        </div>
        <div class="modal-footer text-center">
          <button class="btn selectButtonOfA sumbit-btn"  type="submit" [disabled]="!editFrom.form.valid">提交</button>
          <button class="btn selectButtonOfA close-btn" role="button" data-dismiss="modal">返回</button>

        </div>
      </div>
      </form>
    </div>
  </div>

  <!--删除-->
  <div class="modal fade deleteModal" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" [class.remove]="isRemove">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header text-center" >
          <div class="col-md-10 col-md-offset-1" style="margin-top: 20px;">
            <img src="assets/img/warn-doat.png" alt="warn">
          </div>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-md-10 col-md-offset-1 text-center">
              <span>您将删除这条记录</span>
            </div>
          </div>
        </div>
        <div class="modal-footer text-center">
          <button class="btn selectButtonOfA reset-btn"  role="button" (click)="deletePollut(deleteId)" data-dismiss="modal">删除</button>
          <button class="btn selectButtonOfA close-btn"  role="button" data-dismiss="modal">取消</button>
        </div>
      </div>
    </div>
  </div>
  <div class="modal fade deleteModal" id="error" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header text-center" >
          <div class="col-md-10 col-md-offset-1" style="margin-top: 20px;">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="errorMessage">错误信息</h4>
          </div>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-md-10 col-md-offset-1 text-center">
              <span>{{errorMessage}}</span>
            </div>
          </div>
        </div>
        <div class="modal-footer2 text-center">
          <div class="form-group search-list-btn">
            <button  class="btn reset-btn"  data-dismiss="modal">确定</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>


